package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.User;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    //    保存用户
    void save(User user);

    //    获取用户
    User findById(Integer id);

    User findByUsername(String username);

    User findByAccount(String account);

    //    更新用户
    void update(User user);

    //    通过名称获取数据
    List<User> selectByName(@Param("username") String username,
                                @Param("pageSize") int pageSize,
                                @Param("pageNum") int pageNum);
}
